<?php

require_once('rb.php');
R::setup('mysql:host=ftp.giemiebier.nl:3306;dbname=personify', 'school', 'admin123');

$countries = R::getAll('select id, name from countries');

$i = 0;
foreach ($countries as $country) {
    $return[$i]['name'] = $country["name"];
    $return[$i]['id'] = $country["id"];
    $i++;
}

echo json_encode($return);

?>